package com.itwn.email.consumer;

import com.itwn.email.producer.a_simple.QueueConfig;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class App {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    // 手动消费消息
    @Test
    public void manualConsumer() {
        Object data = rabbitTemplate.receiveAndConvert(QueueConfig.SIMPLE_QUEUE);
        System.out.println("data = " + data);
    }
}
